using System;
using System.Collections.Generic;
using System.ComponentModel;
using Iesi.Collections;
using Iesi.Collections.Generic;
using METODESA.Server.Data.Components;
using METODESA.Server.Data.Exceptions;
using METODESA.Server.Data.METODESA.Entity;

namespace METODESA.Server.Data.METODESA.Entity 
{    
	/// <summary>
	/// An object representation of the OrdenVenta table
	/// </summary>
	[Serializable]
	public partial class OrdenVenta
	{
		private System.Int32 _Id;
       
        private System.Int32 _Estado;
		private Cliente _Cliente;
		private Empleado _Empleado;
		private System.String _Fecha;
		private ISet<DetalleVenta> _DetalleVenta ;
	    private ISet<Servicio> _Servicio;
        private Double _Monto;
		
		private System.String _Tipo;
		private System.String _TipoPago;



	    public virtual Cliente Cliente
		{
			get
			{
				return _Cliente;
			}
			set
			{
				_Cliente = value;
			}
		}
		public virtual Empleado Empleado
		{
			get
			{
				return _Empleado;
			}
			set
			{
				_Empleado = value;
			}
		}
		public virtual string Fecha
		{
			get
			{
				return _Fecha;
			}
			set
			{
				_Fecha = value;
			}
		}

		public virtual ISet<DetalleVenta> detalleVenta
		{
			get
			{
				return _DetalleVenta;
			}
            set
            {
                _DetalleVenta = value;
            }
		}
		
		public virtual System.Int32 Id
		{
			get
			{
				return _Id;
			}
			set
			{
				_Id = value;
			}
		}

        public virtual System.Double Monto
        {
            get
            {
                return _Monto;
            }
            set
            {
                _Monto = value;
            }
        }
        public virtual System.Int32 Estado
        {
            get
            {
                return _Estado;
            }
            set
            {
                _Estado = value;
            }
        }

        public virtual ISet<Servicio> Servicio
		{
			get
			{
				return _Servicio;
			}
			set
			{
				_Servicio = value;
			}
		}
		public virtual System.String Tipo
		{
			get
			{
				return _Tipo;
			}
			set
			{
				if (value == null)
				{
					throw new BusinessException("TipoRequired", "Tipo must not be null.");
				}
				_Tipo = value;
			}
		}

		public virtual System.String TipoPago
		{
			get
			{
				return _TipoPago;
			}
			set
			{
				if (value == null)
				{
					throw new BusinessException("TipoPagoRequired", "TipoPago must not be null.");
				}
				_TipoPago = value;
			}
		}


		protected bool Equals(OrdenVenta entity)
		{
			if (entity == null) return false;
			if (!base.Equals(entity)) return false;
			if (!Equals(_Id, entity._Id)) return false;
			return true;
		}

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(this, obj)) return true;
			return Equals(obj as OrdenVenta);
		}

		public override int GetHashCode()
		{
			int result = base.GetHashCode();
			result = 29*result + _Id.GetHashCode();
			return result;
		}

	}
}
